/**
 * 获取环境前缀
 */
export default (function getPrefix() {
    const list = ['test.', 'release.', 'jsdotech.'];
    let prefix = '';
    return function _getPrefix() {
        if (prefix !== '') {
            return prefix;
        }
        const domain = location.host;
        if (domain.indexOf('localhost') === 0) {
            return 'http://toker-dashboard-api.jsdotech.com/';
        }
        list.some((item) => {
            if (domain.indexOf(item) === 0 || domain.indexOf('www.' + item) === 0) {
                prefix = item;
            }
        });
        return prefix;
    };
})();
